home *** CD-ROM | disk | FTP | other *** search
/ Champak 33 / Volume 33 - JOGO DISK .iso / Games / space_escape.swf / scripts / DefineSprite_106_game_display_map / frame_1 / DoAction.as
Text File  |  2007-01-15  |  2KB  |  56 lines

  1. if(_root.game.world._width > _root.game.world._height)
  2. {
  3.    divide = _root.game.world._width;
  4. }
  5. else
  6. {
  7.    divide = _root.game.world._height;
  8. }
  9. this.createEmptyMovieClip("shape",0);
  10. this.shape.beginFill("0x00FFFF",75);
  11. i = 0;
  12. while(i < _root.mapsArray[_root.levelNumber][4].length)
  13. {
  14.    if(_root.mapsArray[_root.levelNumber][4][i][0] == "moveTo")
  15.    {
  16.       this.shape.moveTo(_root.mapsArray[_root.levelNumber][4][i][1] / divide * 350,_root.mapsArray[_root.levelNumber][4][i][2] / divide * 350);
  17.    }
  18.    else
  19.    {
  20.       this.shape.lineTo(_root.mapsArray[_root.levelNumber][4][i][1] / divide * 350,_root.mapsArray[_root.levelNumber][4][i][2] / divide * 350);
  21.    }
  22.    i++;
  23. }
  24. this.shape.endFill();
  25. halfWidth = 50 / divide * 350;
  26. halfHeight = 50 / divide * 350;
  27. startLocX = _root.mapsArray[_root.levelNumber][2][0] / divide * 350;
  28. startLocY = _root.mapsArray[_root.levelNumber][2][1] / divide * 350;
  29. this.shape.beginFill("0xFF0000",75);
  30. this.shape.moveTo(startLocX - halfWidth,startLocY - halfHeight);
  31. this.shape.lineTo(startLocX + halfWidth,startLocY - halfHeight);
  32. this.shape.lineTo(startLocX + halfWidth,startLocY + halfHeight);
  33. this.shape.lineTo(startLocX - halfWidth,startLocY + halfHeight);
  34. this.shape.lineTo(startLocX - halfWidth,startLocY - halfHeight);
  35. this.shape.endFill();
  36. endLocX = _root.mapsArray[_root.levelNumber][3][0] / divide * 350;
  37. endLocY = _root.mapsArray[_root.levelNumber][3][1] / divide * 350;
  38. this.shape.beginFill("0x00FF00",75);
  39. this.shape.moveTo(endLocX - halfWidth,endLocY - halfHeight);
  40. this.shape.lineTo(endLocX + halfWidth,endLocY - halfHeight);
  41. this.shape.lineTo(endLocX + halfWidth,endLocY + halfHeight);
  42. this.shape.lineTo(endLocX - halfWidth,endLocY + halfHeight);
  43. this.shape.lineTo(endLocX - halfWidth,endLocY - halfHeight);
  44. this.shape.endFill();
  45. yourLocX = (- _root.game.world._x + 300) / divide * 350;
  46. yourLocY = (- _root.game.world._y + 225) / divide * 350;
  47. this.shape.beginFill("0xFFFF00",100);
  48. this.shape.moveTo(yourLocX - 2,yourLocY - 2);
  49. this.shape.lineTo(yourLocX + 2,yourLocY - 2);
  50. this.shape.lineTo(yourLocX + 2,yourLocY + 2);
  51. this.shape.lineTo(yourLocX - 2,yourLocY + 2);
  52. this.shape.lineTo(yourLocX - 2,yourLocY - 2);
  53. this.shape.endFill();
  54. this.shape._x = (600 - this.shape._width) / 2;
  55. this.shape._y = (450 - this.shape._height) / 2;
  56.